import configparser
import os, sys


class DataConfigParser(object):

    _inst = None
    _data_cf = configparser.ConfigParser()

    def __new__(cls):
        if cls._inst is None:
            cls._inst = object.__new__(cls)

            dirname, filename = os.path.split(os.path.abspath(sys.argv[0]))
            cls._data_cf.read(dirname + "/config/config.ini")
        return cls._inst

    def get_data_configuration(self, category, parameter):
        return self._data_cf.get(category, parameter)


